<?php  if (!defined('BASEPATH')) exit('No direct script access allowed');

class template_type_detail_model extends Model
{
	var $url_prefix2 = 'admin/template_type.template_type.lists';
	var $url_prefix = 'admin/template_type.template_type.detail';
	var $start_segment = 3;
	var $start;
	var $msg_cache_prefix = 'msg';
	var $cache;
	var $cache_name = 'template_type';
	var $item_segment = 4;
	var $item;
	
	function template_type_detail_model()
	{
		parent::Model();
		
		global $CI;
		$start = $CI->uri->segment($this->start_segment);
		$this->start = $start?$start:0;
		
		$item = $CI->uri->segment($this->item_segment);
		$this->item = $item?$item:0;
		
		$this->cache = new Session_lite($this->cache_name);
	}
	
	function admin_id()
	{
		global $CI;
		$a = $CI->session->userdata('admin_auth_logged');
		return $a['admin_id'];
	}
	
	function hasTemplate_type()
	{
		return $this->item>0;
		/*$q = $this->db->get_where(TEMPLATE_TYPES, array(TEMPLATE_TYPES_FRANCHISE_ID=>$this->admin_id(), TEMPLATE_TYPES_TEMPLATE_TYPE_ID=>$this->item));
		return $q->num_rows()>0;*/
	}
}

?>
